package com.dao.impl;

import com.dao.MemberDao;
import com.entity.Member;
import com.entity.MemberExample;
import com.mapper.MemberMapper;
import com.page.PageInfo;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository("memberDao")
public class MemberDaoImpl implements MemberDao {
    @Resource
    private MemberMapper memberMapper;

    @Override
    public List<Member> getAllMembers() { return memberMapper.selectByExample(null); }

    /**
     * @param pageInfo
     * @return
     */
    @Override

    public List<Member> getMemberByPage(PageInfo pageInfo) {
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("currPage",pageInfo.getCurrPage());
        map.put("pageSize",pageInfo.getPageSize());
        System.out.println("111");

        return memberMapper.getMemberByPage(map);
    }

    @Override
    public List<Member> selectByMtno(String mtno) {
        return memberMapper.selectByMtno(mtno);
    }
}
